#include "util/SimSupers.h"

TypeMap& simSupers() {
    static TypeMap* simSupers = new TypeMap();
    return *simSupers;
}

bool is_a (const std::type_info &type, const std::type_info &query) {
    const std::type_info *t = &type;
    const std::type_info *q = &query;
    while (q != &typeid(NoSuper) && q != NULL) {
        if (q == t) {
            return true;
        }
        q = simSupers()[q];
    }
    return false;
}
